package mlz.d_object;

public class DemoTest02 {
    public static void main(String[] args) throws CloneNotSupportedException {
        System.out.println("-----------clone----------");
        Student stu1 = new Student("lucy", 12);
        Student stu2  = (Student) stu1.clone();
        System.out.println(stu2 == stu1);//false  内存地址值不相同

        Student stu3 = stu1;
        System.out.println(stu3 == stu1);//true

        System.out.println("-----------finalize----------");
        Student stu4 = new Student("marry", 18);
        //GC:回收没有引用的对象(垃圾对象)
        stu4 = null;
        System.gc();
    }
}
